using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace trainstorm.InstanceClass.Obstacles
{
	class Frog : Obstacle
	{
		private bool naik;
		public Frog(Game1 game1, int randomVel, Vector2 _pos)
			: base(game1, 1, new Vector2(randomVel,0), _pos) 
		{
			scale = 0.4f;
			naik = false;
		}
		public override void update(GameTime gameTime, float screenVel)
		{
			
			vel.Y += (float)(gameTime.ElapsedGameTime.TotalSeconds) * 98 * 5f;
			pos.X -= (float)(gameTime.ElapsedGameTime.TotalSeconds) * (vel.X - screenVel-295);
			pos.Y += (float)(gameTime.ElapsedGameTime.TotalSeconds) * vel.Y;

			if ((pos.Y < 50) || (pos.Y + gambar.Height * scale > 370))
			{
				vel.Y *= -1;
				if (pos.Y + gambar.Height * scale > 370)
				{
					pos.Y = 449 - gambar.Height * scale;

				} 
			}
		}
	}
}
